package club.jdiy.core.convert;

import java.math.BigDecimal;
import java.math.BigInteger;

class BigDecimalConverter extends NumberConverter<BigDecimal> {

    public BigDecimalConverter(BigDecimal source) {
        super(source);
    }

    @Override
    public Boolean getBoolean() {
        return source.compareTo(BigDecimal.ZERO) != 0;
    }

    @Override
    public BigDecimal getBigDecimal() {
        return getSource();
    }

    @Override
    public BigInteger getBigInteger() {
        return source.toBigInteger();
    }

    @Override
    public String getString() {
        return source.toPlainString();
    }
}
